public class demo2 {
    class Solution {
        public int countSubstrings(String s) {
            int n=s.length();
            boolean
        }
    }
}
